home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Gold Collection / Software Vault - The Gold Collection (American Databankers) (1993).ISO / cdr30 / scr210a.zip / BURNOUT.DOC < prev    next >
Text File  |  1993-01-23  |  21KB  |  570 lines

  1.                               V2.10 12-Jun-1985
  2.  
  3.                Burnout II Documentation
  4.                ------------------------
  5.  
  6.     Function
  7.     --------
  8.     Burnout is an enhanced version of the old screen blanking
  9.     program of the same name; its primary purpose is to blank out
  10.     your video display after a specified length of time.  This new
  11.     version is signifcantly enhanced over the older program; not
  12.     only does it allow you better control over its operations, but
  13.     it is written as a virtual device driver so that you can control
  14.     it directly from your own programs.
  15.  
  16.  
  17.     V2.10 Notes
  18.     -----------
  19.     This version finally adds "on demand" screen blanking.  By
  20.     pressing the left shift key and <Ctrl> simultaneously, you can
  21.     force the screen to blank.  The key combination can be altered
  22.     via the new F parameter.
  23.  
  24.  
  25.     Installation
  26.     ------------
  27.     To install burnout, follow two steps: place the file BURNDEV.SYS
  28.     in the root directory of your boot diskette or hard disk, and
  29.     modify the CONFIG.SYS file to include the statement
  30.     "device=burndev.sys".
  31.  
  32.     In case you are not familiar with CONFIG.SYS: this is a small
  33.     text file which DOS reads when booting.  It contains various
  34.     pieces of information which DOS and other programs can use when
  35.     setting themselves up.    Look in the root directory of your boot
  36.     disk for the file CONFIG.SYS.  If no such file exists, just
  37.     type:
  38.  
  39.         copy con \config.sys<Enter>
  40.         device=burndev.sys<Enter>
  41.  
  42.     Then press Ctrl-Z (you'll see "^Z") and <Enter>, and you're
  43.     done.
  44.  
  45.     If you already have a CONFIG.SYS file (which is likely), you
  46.     must edit it to include the statement "device=burndev.sys".  Do
  47.     this using your text editor or word processor in text mode (or
  48.     Edlin, heaven forbid).    Retain all existing information, and add
  49.     the new line.
  50.  
  51.     Now reboot your machine.  If all goes well, it will boot as
  52.     usual.    There will be no indication that anything has happened.
  53.     However, the screen should blank out after about ten minutes of
  54.     inactivity.  You can clear the screen instantly by pressing the
  55.     left shift key and <Ctrl> simultaneously.  After the screen has
  56.     cleared, any keystroke and most video activity will restore it.
  57.  
  58.  
  59.     Burnout parameters
  60.     ------------------
  61.     There are several ways in which you can alter the operation of
  62.     burnout.  There is a demo program called BURNOUT.COM which you
  63.     can use for this purpose.  Its syntax is as follows:
  64.  
  65.         burnout [count] [V+-] [H+-] [C+-]
  66.  
  67.     The parameters are as follows:
  68.  
  69.     COUNT: changes the number of clock ticks until the screen
  70.     blanks (this is called the "reset count").  For example,
  71.  
  72.         burnout 5000
  73.  
  74.     sets the reset count to 5000.  This means that if burnout
  75.     observes no keyboard or video activity within 5000 clock
  76.     ticks, it will blank the screen.  On the IBM PC, there are
  77.     about 18.2 ticks per second, so this means that the screen will
  78.     clear after about 5000/18.2 seconds (275 seconds, or about four
  79.     and a half minutes).  (The default value on powerup is 10800
  80.     ticks, or about 10 minutes).  You can set the reset count
  81.     anywhere from 1 tick (not highly recommended) to 65535 ticks
  82.     (about an hour).
  83.  
  84.     If you set the reset count to 0, burnout will be effectively
  85.     "deinstalled" (equivalent to the old BURNOUT /Q) until you set a
  86.     new nonzero count.  This is useful for programs that don't get
  87.     along with the screen blanker.
  88.  
  89.     V: This stands for Video, and tells burnout whether you want it
  90.     to monitor video activity in adddition to keyboard activity.
  91.     You can set either "V+" (monitor video), or "V-" (don't).  Thus,
  92.  
  93.         burnout 5000 V-
  94.  
  95.     sets the program to reset to 5000 ticks, and not to monitor
  96.     video.    Why would you not want to monitor video?  Primarily
  97.     because some programs continuously update the display (e.g.,
  98.     with a ticking clock) even when they're not doing anything.  If
  99.     you set V+, the screen would never blank.  The default setting
  100.     is V+.    (V- is equivalent to the old "BURNOUT /K" command).
  101.  
  102.     H: This stands for Hardware, and tells burnout whether you want
  103.     it to blank the screen by manipulating the hardware (i.e., by
  104.     turning off the video signal), or by software (which it does by
  105.     temporarily changing screen attributes to black-on-black, or
  106.     nondisplay).  Some explanation is in order.
  107.  
  108.     The preferred method of blanking the screen is to do it by
  109.     manipulating the PC's video controller.  This method is very
  110.     fast and in general has fewer problems than the software method.
  111.     However, it does have two problems.  First, it is nonportable:
  112.     it doesn't work with all PC-compatibles.  Second, there have
  113.     been reports that this method can PHYSICALLY DAMAGE a few
  114.     non-IBM video adapters, notably the Hercules and similar cards.
  115.  
  116.     The effect of hardware blanking on the IBM Enhanced Graphics
  117.     Adapter is as yet unclear, and I recommend that you
  118.     use software blanking for now.    I do not claim that burnout
  119.     fully supports the EGA as of Version 2.10.
  120.  
  121.     DO NOT USE H+ IF YOU ARE USING A HERCULES OR SIMILAR VIDEO
  122.     ADAPTERS!!! YOU HAVE BEEN WARNED!!!
  123.  
  124.     If you ARE using a standard IBM video adapter or the equivalent,
  125.     try H+, with a setting of about 10 seconds, to make sure it
  126.     works:
  127.  
  128.         burnout 180 H+
  129.  
  130.     The screen should blank in about 10 seconds.  If it does not,
  131.     you will have to use H- (which is the default [safe] setting).
  132.     Reset burnout to some reasonable period of time, of course,
  133.     after you have tested.
  134.  
  135.     C: This stands for Continuous Clear.  If you are using H+, you
  136.     can skip this one, because it is ignored in hardware blanking
  137.     mode.  As mentioned above, software blanking is achieved by
  138.     simply changing all video attributes to nondisplay
  139.     (black-on-black).  Now, if you are running in V- mode (not
  140.     monitoring video), or if you are running a program which
  141.     achieves video output by writing data directly to screen memory,
  142.     new data will begin to appear on the screen, even though it is
  143.     blanked.  Continuous Clear attempts to remedy this by simply
  144.     resetting all the attributes to black-on-black every time the
  145.     clock ticks (18 times per second).  The new data will flash on
  146.     the screen and disappear immediately.  C- is equivalent to the
  147.     old "BURNOUT /N" command.
  148.  
  149.     F: This stands for Forced clear.  It allows you to alter the
  150.     key combination which will clear the screen instantly.    You will
  151.     need these codes:
  152.  
  153.         Right shift:  1
  154.         Left shift:   2
  155.         Ctrl:          4
  156.         Alt:          8
  157.  
  158.     Decide what keys you want to use (any combination is OK), and
  159.     add up the codes.  For example, if you want the screen to clear
  160.     when you press both shift keys, add 1 + 2.  Use the sum with the
  161.     F parameter:
  162.  
  163.         BURNOUT F3
  164.  
  165.     If you wish to disable forced blanking, use zero:
  166.  
  167.         BURNOUT F0
  168.  
  169.     Note that the maximum valid parameter is 15 (1+2+4+8, meaning
  170.     all four keys must be pressed).  Any parameter above 15 will be
  171.     ignored.
  172.  
  173.             *    *    *    *
  174.  
  175.     The burnout parameters can be entered in any order; illegal
  176.     parameters, capitalization, and separators are IGNORED.  Thus,
  177.     the following are all equivalent:
  178.  
  179.         burnout 5000 V+ H- F6
  180.         burnout F6v+h-5000
  181.         burnout H+, F6, V-, 5000
  182.         burnout 5000H-F6V+
  183.  
  184.     Obviously, you cannot enter something like:
  185.  
  186.         burnout F75000
  187.  
  188.     to set the force keys to 7 and the count to 5000.  You'd have to
  189.     use "5000F7" or "5000, F7", etc.  In particular, note that
  190.     "F7,5000" will NOT work.  When I said that separators are
  191.     ignored, I meant ignored.  "F7, 5000" and "F75000" are
  192.     identical insofar as burnout is concerned.
  193.  
  194.     If you enter a COUNT greater than 65535, you're on your own.
  195.     You won't get what you expect.
  196.  
  197.     If you don't like the way BURNOUT.COM works, you're free to
  198.     "roll your own"; see the next section.
  199.  
  200.     When BURNOUT is finished, it will display the current device
  201.     status.  For example:
  202.  
  203.         Status: 09994,10000, ,C-,V+,H+
  204.  
  205.     The format of the status line is:
  206.  
  207.         Status: nnnnn,nnnnn,B,C+-,V+-,H+-
  208.  
  209.     The first number is the current number of clock ticks remaining
  210.     till the next screen blank; the second is the reset count (in
  211.     this case, the two numbers will be very close).  The "B", if
  212.     present, indicates that the screen is currently Blanked (you
  213.     won't see this after running BURNOUT).  The "C", "V", and "H"
  214.     flags indicate the current status of Continuous Clear, Video
  215.     monitoring, and Hardware clearing.  If the parameter is active,
  216.     the indicator will be followed by a plus sign (+), otherwise a
  217.     minus sign (-).  In the above example, then, the current count
  218.     is 09994, the reset count is 10000, the screen is not blanked
  219.     (naturally), Continous Clear is off, and Video monitoring and
  220.     Hardware clearing are on.
  221.  
  222.     If you run burnout without any parameters, it will simply
  223.     display status without changing anything.
  224.  
  225.     You can also include any of these parameters in the config.sys
  226.     file so that they will be set immediately when you boot.  For
  227.     example,
  228.  
  229.         device=burndev.sys 8000 H+ V- F5
  230.  
  231.  
  232.     Using the BRNDEV device
  233.     -----------------------
  234.     As mentioned above, the screen blanker is implemented as a
  235.     virtual device.  The advantage to this is that it can be
  236.     interrogated or controlled very easily, from the DOS command
  237.     line or from your own programs.  In fact, BURNOUT.COM is a very
  238.     simple program which takes your command line parameters, sends
  239.     them to the burnout device, reads the current status back from
  240.     the device, and displays the results.  This section explains how
  241.     to do this.
  242.  
  243.     When DOS finds the "device=burndev.sys" line in config.sys, it
  244.     loads and installs the burndev.sys program as a virtual device.
  245.     What this means, practically speaking, is that there is now a
  246.     new "device" attached to your PC. You already have several
  247.     devices installed: CON, PRN, COM1 and COM2, AUX, your disk
  248.     drives, and possibly a RAM (or virtual) disk if you have
  249.     installed VDISK.SYS or another disk emulator.
  250.  
  251.     The new device is known to DOS by the name "BRNDEV" (note: this
  252.     is NOT "BURNDEV", it's "BRNDEV", no U). Like other devices, you
  253.     can write (send information) to the device, and you can read
  254.     (receive information) from the device.    BRNDEV is designed to
  255.     accept certain very specific information (the burnout
  256.     parameters) when it is written to, and to return certain very
  257.     specific information (the burnout status) when it is read from.
  258.  
  259.  
  260.     Writing to BRNDEV
  261.     -----------------
  262.     How do you "write" to BRNDEV?  There are many ways.  The
  263.     simplest is to do it right from the keyboard, at the DOS prompt:
  264.  
  265.         copy con brndev<Enter>
  266.         @8000 V-#<Enter>
  267.         ^Z<Enter>
  268.  
  269.     The "copy con brndev" command instructs DOS that you want to
  270.     copy input from the console device to the BRNDEV device.  The
  271.     console input "@5000 V-#<Enter>" is copied to the burnout device
  272.     when you hit the Ctrl-Z (end of copy) and <Enter> (execute)
  273.     keys.  To prove it worked, type "burnout" and look at the new
  274.     parameters; they should reflect a reset count of 8000 and no
  275.     video monitoring.  (The significance of @ and # will be
  276.     explained shortly.)
  277.  
  278.     Another way to write to the device would be to copy a small
  279.     textfile to BRNDEV.  As an example, type
  280.  
  281.         copy con brndemo.txt<Enter>
  282.         @10000V+#<Enter>
  283.         ^Z<Enter>
  284.  
  285.     You should now have a small textfile, the contents of which are
  286.     "@10000V+#".  To sen it to BRNDEV, just type
  287.  
  288.         copy brndemo.txt brndev
  289.             or
  290.         type brndemo.txt > brndev
  291.  
  292.     Run burnout to prove that the parameters have changed.
  293.  
  294.     The purpose of the "@" at the beginning of the output to BRNDEV
  295.     is to tell the device to flush or rewind its I/O buffers.
  296.     BRNDEV just sees a sequence of characters coming from DOS; it
  297.     has no particular way to know when it is getting a new sequence
  298.     of command characters.    The "@" tells it to get rid of any old,
  299.     leftover junk and to start fresh.  Make a habit of prefixing all
  300.     BRNDEV commands with an @ symbol.
  301.  
  302.     The "#" is the "execute" character.  It tells BRNDEV that it has
  303.     received the whole parameter list.  Only when BRNDEV sees the #
  304.     will it examine the parameter list and execute the commands.
  305.     Thus, "#" should be at the end of all BRNDEV commands; something
  306.     like "@5000 C+H-" will have no effect at all.  "#" also has a
  307.     second purpose, which will be covered below.
  308.  
  309.     It is also possible, of course, to send commands to BRNDEV from
  310.     high level languages or from assembler programs.  Here's a BASIC
  311.     example:
  312.  
  313.         10 OPEN "BRNDEV" FOR OUTPUT AS #1
  314.         20 PRINT #1, "@5000 C+ H-#";
  315.         30 CLOSE 1
  316.  
  317.     And C (this is C86); you'd want to add some error detection:
  318.  
  319.         {
  320.         FILE *burnout, *fopen();
  321.         static char command[] = "@5000 C+ H-#";
  322.  
  323.             burnout = fopen("BRNDEV","w");
  324.             fwrite(command, 1, strlen(command), burnout);
  325.             fclose(burnout);
  326.         }
  327.  
  328.     For an 8086 assembler example, see the source for BURNOUT.COM
  329.     (BURNOUT.ASM), which is included in the burnout library.
  330.     Basically, you have to open the device (filename=BRNDEV, fomode
  331.     0 or 2), and use function 40H (FWRITE) to write bytes to the
  332.     device using the returned handle.
  333.  
  334.  
  335.     Reading from BRNDEV
  336.     -------------------
  337.  
  338.     Unfortunately, reading from BRNDEV is not quite as simple as
  339.     writing to it.    There's no way that I can think of to do it from
  340.     the command line; you really need a program (I suppose you could
  341.     CTTY BRNDEV and then reboot when the machine went crazy [just
  342.     kidding, don't try it]).  Also, there is a bug in DOS 2.x which
  343.     prevents you from using BASIC for this purpose (fixed under 3.0,
  344.     however).  Under 3.0, the BASIC program would be:
  345.  
  346.         10 OPEN "BRNDEV" FOR OUTPUT AS #1
  347.         20 PRINT #1, "@#";
  348.         30 CLOSE 1
  349.         40 OPEN "BRNDEV" FOR INPUT AS #1
  350.         50 BSTAT$ = INPUT$(19,1)
  351.         60 CLOSE 1
  352.         70 PRINT "Burnout status is "; BSTAT$
  353.  
  354.     Note that we always write an "@#" to the device before reading
  355.     its status.  The @'s function is described as above, to flush
  356.     any unfinished I/O from BRNDEV's buffers.  The # is used for a
  357.     slightly different purpose, however.  It still tells BRNDEV to
  358.     execute any pending commands (but there are none, because the @
  359.     just flushed them).  The second purpose of # is the key one
  360.     here: it tells BRNDEV to prepare for a status request.    When
  361.     BRNDEV sees the #, it examines its current status and puts the
  362.     data into a buffer, from which it will be retrieved when it gets
  363.     the request.  Without the preparatory #, you'll get old data.
  364.  
  365.     The significance of the "19" in the INPUT$ statement is that the
  366.     BRNDEV status report is 19 characters long.
  367.  
  368.     Here's a C example:
  369.  
  370.         {
  371.         FILE *burnout, *fopen();
  372.         static char command[] = "@#";
  373.         char status[30];
  374.  
  375.             burnout = fopen("BRNDEV","rw");
  376.             fwrite(command, 1, strlen(command), burnout);
  377.             fread (status, 1, 255, burnout);
  378.             fclose(burnout);
  379.             printf("Burnout status is %s\n", status);
  380.         }
  381.  
  382.     Note that we requested 255 characters.    DOS, in general, will
  383.     halt a device read when it encounters a carriage return from the
  384.     input stream.  BRNDEV makes a habit of sending a CR after the
  385.     last byte of the status report, so this will terminate the read
  386.     automatically; no need to worry about the true length of the
  387.     report.  BASIC, however, will just keep reading until it
  388.     accumulates the requested number of characters, so you do have
  389.     to be watchful there.  The same trick (requesting too many
  390.     characters) will also work in assembler programs (again, see
  391.     BURNOUT.ASM).
  392.  
  393.     Now, about that bug in DOS 2.x.  It turns out that DOS will mess
  394.     up if you ever request a single byte from an installed character
  395.     device, which is what BRNDEV is.  (Technically: EOF is set on
  396.     the device, and you will not be able to do any further reads
  397.     unless you mess with IOCTL and explicitly reset EOF.)  Thus, the
  398.     following assembler code will NOT work under 2.x:
  399.  
  400.         mov cx,19      ; Loop for 19 bytes
  401.     Label:
  402.         push cx       ; Save loop count
  403.         mov ah,3FH      ; Read from file
  404.         mov bx,BHandle      ; BRNDEV file handle (from FOPEN)
  405.         mov cx,1      ; One byte at a time
  406.         mov dx,offset buf ; Where to put the data
  407.         int 21H       ; Perform read
  408.         (do something with the byte)
  409.         pop cx          ; Recover loop count
  410.         loop label      ; Loop till 19 bytes read
  411.  
  412.     The first byte will be read OK, but no further input will be
  413.     received.  You MUST read at least 2 bytes at a time.
  414.  
  415.     This bug can be overcome in assembler and C by simply requesting
  416.     the full status report in one read.  However, it appears that
  417.     BASIC requests only one byte at a time, even if you use
  418.     something like INPUT$(19,n).  Reading the second byte then
  419.     results in a READ PAST EOF error.
  420.  
  421.  
  422.     Tricks
  423.     ------
  424.     You can do neat stuff like waiting for the screen to burn out,
  425.     then turning it back on:
  426.  
  427.         1  REM DEMO PROGRAM TO WAIT UNTIL SCREEN BLANKS
  428.         2  REM
  429.         10 OPEN "BRNDEV" FOR OUTPUT AS #1
  430.         20 OPEN "BRNDEV" FOR INPUT AS #2
  431.         30 WHILE NOT BURNED.OUT
  432.         40    PRINT #1,"@#";
  433.         50    A$ = INPUT$(19,2)
  434.         60    BURNED.OUT = (MID$(A$,13,1) = "B")
  435.         70 WEND
  436.         80 BEEP: PRINT "Burned out!"
  437.         90 CLOSE 1: CLOSE 2
  438.  
  439.     The 13th character of the status report, "B", will appear in the
  440.     report only when the screen is blanked.
  441.  
  442.     Also, your programs can cancel burnout totally, if desired:
  443.  
  444.         1  REM DEMO PROGRAM TO DISABLE BURNOUT
  445.         2  REM
  446.         10 OPEN "BRNDEV" FOR OUTPUT AS #1
  447.         20 PRINT #1,"@0#";
  448.         30 CLOSE 1
  449.  
  450.     (I am not a BASIC programmer, so if any of these demo BASIC
  451.     programs are dumb, someone tell me.)
  452.  
  453.     Naturally, it would be possible (and friendly) to read in the
  454.     burnout parameters, modify them while your program is running,
  455.     and restore the original parameters when you are done.
  456.  
  457.     You can test whether or not BRNDEV is installed in a batch file
  458.     by using the IF EXIST function:
  459.  
  460.         if exist brndev (do something)
  461.  
  462.     If you use Seaware's Extended Batch Language, you can use this
  463.     test instead:
  464.  
  465.         bat stateof BRNDEV
  466.         bat if %r = 0 type BURNOUT IS INSTALLED | goto -A1
  467.         bat type BURNOUT IS NOT INSTALLED
  468.         bat -A1
  469.  
  470.     If you have a one-floppy machine, you can trick DOS and BAT into
  471.     not checking the second logical drive (and stopping the batch to
  472.     ask you to "Insert diskette for drive B") by using
  473.  
  474.         if exist a:brndev (in DOS batches)
  475.         bat stateof A:BRNDEV (in EBL batches)
  476.  
  477.     DOS apparently doesn't care if you prefix a device name with a
  478.     drive ID.
  479.  
  480.  
  481.     Incompatibilities and Problems
  482.     ------------------------------
  483.     I am aware of only a few problems and interactions with other
  484.     programs.  In order for burnout to "see" keyboard and video
  485.     activity, active programs must use ROM BIOS (or DOS, which
  486.     itself uses BIOS) for their keyboard input and video output.
  487.     A few progams use neither; hence burnout never sees their
  488.     activity, and the screen will be irrevocably blanked.  These
  489.     programs are mostly word processors; two that I know of are
  490.     XYWrite and WordVision.  You must disable burnout before using
  491.     either of these ("BURNOUT 0" will do the trick).  Most people do
  492.     this in a batch:
  493.  
  494.         burnout 0
  495.         wv
  496.         burnout 10000
  497.  
  498.     There are also problems with some communications programs if you
  499.     use software blanking.    If you are performing an extended length
  500.     file transfer the screen may blank during the transfer.
  501.     Software blanking takes a little time, and communications input
  502.     can be lost while it is being accomplished.  This, of course,
  503.     messes up the transfer.  And Continuous Clear is even worse.
  504.     The solution is to either use hardware blanking, or to disable
  505.     burnout while transfers are taking place.  You MAY be able to
  506.     get away with leaving burnout enabled, but disabling Continuous
  507.     Clear (C-).
  508.  
  509.     Note that the word "BRNDEV" becomes a reserved word to DOS.  You
  510.     cannot name any file BRNDEV (or even BRNDEV.TXT, or whatever).
  511.     DOS won't let you do that.  If you do succeed, you won't be able
  512.     to erase it.  This is why the driver is stored in a file named
  513.     BURNDEV.SYS rather than BRNDEV.SYS.
  514.  
  515.  
  516.     Tick chart
  517.     ----------
  518.     To save wear and tear on your calculator, here are some
  519.     approximate tick counts:
  520.  
  521.         Minutes   Count
  522.         -------   -----
  523.            1       1100
  524.            2       2200
  525.            3       3275
  526.            4       4375
  527.            5       5450
  528.            6       6550
  529.            7       7650
  530.            8       8725
  531.            9       9825
  532.           10      10920
  533.           20      21850
  534.           30      32760
  535.           40      43680
  536.           50      54600
  537.           60      65520
  538.  
  539.  
  540.  
  541.     The Usual Suspects
  542.     ------------------
  543.     The author accepts no responsibility for this software
  544.     whatsoever.  It might work, it might not.  In particular, he
  545.     accepts no responsibility for any result of the use of the
  546.     software, even if it results in damage to your hardware.
  547.     By using the software, you agree to this.
  548.  
  549.     The burnout device driver (BURNDEV.SYS) and all demonstration
  550.     programs are placed in the public domain and may be freely used
  551.     by any individual.  You may not use them commercially.    You may
  552.     copy and distribute the software and documentation to any other
  553.     individual, PROVIDED that you do not charge for this.
  554.  
  555.     RECOGNIZED USERS' GROUPS may, however, charge a small fee
  556.     (not to exceed $6) for postage and materials.
  557.  
  558.     I am interested in comments or suggestions on the usability of
  559.     the burnout system, especially by programmers.    Contact me via
  560.     CompuServe if possible.
  561.  
  562.  
  563.               All software and documentation are
  564.  
  565.                  Copyright (c) 1985 by
  566.                 Christopher J. Dunford
  567.                10057-2 Windstream Drive
  568.                Columbia, Maryland 21044
  569.                CompuServe ID 76703,2002
  570.